package com.ostrich.cloud.ostrichPermission.client;


import com.ostrich.cloud.common.result.Result;
import com.ostrich.cloud.ostrichPermission.client.param.AddUserParam;
import com.ostrich.cloud.ostrichPermission.client.param.UpdateUserStatusParam;
import com.ostrich.cloud.ostrichPermission.infra.model.Perm;
import com.ostrich.cloud.ostrichPermission.infra.model.Role;
import com.ostrich.ostrichUserService.param.LoginCusParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "permissionClient",name="ostrichPermission")
public interface PermissionClient {


    @PostMapping("addUser")
    public Result addUser(@RequestBody AddUserParam param);
    @GetMapping("selectByPid")
    public Result selectByPid(@RequestParam("parentId") Integer parentId);
    @PostMapping("updateStatus")
    Result UpdateUserStatus(@RequestBody UpdateUserStatusParam updateUserStatusParam);
    @GetMapping("getRoleList")
    public List<Role> getRoleListByPid(@RequestParam("parentId") Integer pid);
    @GetMapping("getPermissionListByPid")
    public List<Perm> getPermissionListByPid(@RequestParam("parentId") Integer pid);
    @GetMapping("login")
    public Result login(@RequestBody LoginCusParam loginCusParam);
}
